]> dgit.raspbian.org Git - gnome-shell.git/commit
swipeTracker: Calculate velocity using scroll history
authorAlexander Mikhaylenko <exalm7659@gmail.com>
Sun, 7 Feb 2021 17:46:49 +0000 (22:46 +0500)
committerGeorges Basile Stavracas Neto <georges.stavracas@gmail.com>
Mon, 8 Feb 2021 22:20:26 +0000 (22:20 +0000)
commitcf87ab04aa8b1596e0d0fc016f7a17fc5571f8f5
tree7f13d506c0144795add37f9e440ff602fc4cc98d
parenta767e568eae59c436835974ef9ee4d8b8328b89e
swipeTracker: Calculate velocity using scroll history

In some cases we may get anevent with very low delta at the end of the
swipe. While we can't completely ignore them, we can smooth them using a
scroll history, similarly to what GTK kinetic scrolling does: keep track
of the last 150ms of events, and sum their deltas when calculating the
velocity.

The logic is based on what GTK does in GtkGestureSwipe and
GtkEventControllerScroll.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1647>
js/ui/swipeTracker.js